import React, { useEffect } from 'react';
import { Table } from 'antd';



const columns = [
  {
    title: '序号',
    dataIndex: 'key',
  },
  {
    title: '商品名称',
    dataIndex: 'proname',
    width: '20%',
  },
  {
    title: '商品图片',
    dataIndex: 'proimg',
  },
  {
    title: '商品分类',
    dataIndex: 'proCategory',
      filters: [
      {
        text: 'Joe',
        value: 'Joe',
      },
      {
        text: 'Category 1',
        value: 'Category 1',
      },
      {
        text: 'Category 2',
        value: 'Category 2',
      },
    ],
    filterMode: 'tree',
    filterSearch: true,
    onFilter: (value, record) => record.name.startsWith(value),
    // width: '20%',
  },
  {
    title: '商品价格',
    dataIndex: 'proPrice',
    sorter: {
      compare: (a, b) => a.proPrice - b.proPrice,
      multiple: 1,
    },
  },
  {
    title: '商品折扣',
    dataIndex: 'proOnSale',
    sorter: {
      compare: (a, b) => a.proOnSale - b.proOnSale,
      multiple: 1,
    },
  },
  {
    title: '是否推荐',
    dataIndex: 'proRecommend',
  },
  {
    title:'是否售卖',
    dataIndex: 'proSale',
  },
  {
    title: '是否秒杀',
    dataIndex: 'proSeckill',  
  },
];
const data = [
  
];
const onChange = (pagination, filters, sorter, extra) => {
  console.log('params', pagination, filters, sorter, extra);
};
const Searchtable = ({data}) => <Table size='large'  columns={columns} dataSource={data} onChange={onChange} />;
export default Searchtable;